package com.shen.GOF.proxy.staticProxy2;

public class UserServiceProxy implements UserService {

    private UserServiceImpl userService;

    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        log("add");
        userService.add();
    }

    @Override
    public void del() {
        log("del");
        userService.del();
    }

    @Override
    public void update() {
        log("update");
        userService.update();
    }

    @Override
    public void getUser() {
        log("getUser");
        userService.getUser();
    }

    public void log(String msg) {
        System.out.println("[DEBUG]" +
                " " + msg + "方法");
    }
}
